package com.crm.CLdriving;

import com.crm.CLdriving.po.StudentPO;
import com.crm.CLdriving.service.TranTest2Service;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * @author chenlong
 * @date 2020/3/26 - 9:52
 **/
@SpringBootTest
@RunWith(SpringRunner.class)
public class test {

    @Autowired
    private TranTest2Service tranTest2Service;

    // 订单处理任务
    @Test
    public void orderTask() throws Exception{ 
    	
    	/**
    	 * 序列化：将对象序列化，储存在D：/po中
    	 */
    	/*OutputStream ous = new FileOutputStream("D://po");
    	ObjectOutputStream oos = new ObjectOutputStream(ous);
    	StudentPO sPo = new StudentPO();
    	sPo.setName("小明");
    	//writeObject将对象储存到对应文件中
    	oos.writeObject(sPo);
    	oos.close();  	 	
    	
    	*//**
    	 * 反序列化：将序列化后储存的文件读取出来，变成对象
    	 *//*
    	InputStream ins = new FileInputStream("D://po");
    	ObjectInputStream ois = new ObjectInputStream(ins);
    	//studentpo 学生信息类
        StudentPO sPo2 = (StudentPO) ois.readObject();
        System.out.println(sPo2.toString());
        ois.close();  */    
    	
    	//1.Class.forName("全类名")
    	Class cla1 = Class.forName("package com.crm.CLdriving.po.student");
    	//2.类名.class
    	Class cla2 = StudentPO.class;
    	//3.对象.getClass()
    	StudentPO sPo = new StudentPO();
    	Class cla3 = sPo.getClass();
    	
    	
    }

}
